import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

export const newRoutes = [
  {
    path: 'about',
    name: 'About',
    meta: {
      title: "关于",
      code:"About"
      // hidden: true,
    },
    component: () => import('@/views/layout/content/About.vue')},
  {
    path: 'my',
    name: 'My',
    meta: {
      title: "我的"
    },
    component: () => import('@/views/layout/content/My.vue')
  },
  {
    path: 'share',
    name: 'Share',
    meta: {
      title: "分享"
    },
    component: () => import('@/views/layout/content/Share.vue')
  },
]


export const routes = [
  {
    path: '/',
    name: 'Index',
    redirect: '/home',
    meta: {
      title:"系统管理",
      icon:"el-icon-chat-dot-square",
    },
    component: () => import('@/views/layout/Index.vue'),
    children:[
      {
        path: 'home',
        name: 'Home',
        meta: {
          title:"首页"
        },
        component: () => import('@/views/layout/content/Home.vue')
      },
      // {
      //   path: 'about',
      //   name: 'About',
      //   meta: {
      //     title: "关于",
      //     code:"About"
      //     // hidden: true,
      //   },
      //   component: () => import('@/views/layout/content/About.vue')},
      // {
      //   path: 'my',
      //   name: 'My',
      //   meta: {
      //     title: "我的"
      //   },
      //   component: () => import('@/views/layout/content/My.vue')
      // },
      // {
      //   path: 'share',
      //   name: 'Share',
      //   meta: {
      //     title: "分享"
      //   },
      //   component: () => import('@/views/layout/content/Share.vue')
      // },
      {
        path: 'news',
        name: 'News',
        meta: {
          title: "消息",
          // hidden: true,
        },
        component: () => import('@/views/layout/content/News.vue'),
        // children:[
        //   {path: 'news', name: 'News', meta: {title: "消息一"},
        //     component: () => import('@/views/layout/content/News.vue')},
        //   {path: 'news', name: 'News', meta: {title: "消息二"},
        //     component: () => import('@/views/layout/content/News.vue')},
        //   {path: 'news', name: 'News', meta: {title: "消息三"},
        //     component: () => import('@/views/layout/content/News.vue')}
        // ]
      }
    ]

  },
  {
    path: '/login',
    name: 'Login',
    meta: {
      title:"登录",
      hidden:true //在菜单中隐藏登录页
    },
    component: () => import('@/views/layout/Login.vue')
  },
]

const router = new VueRouter({
  mode: 'history',
  routes
})

export default router
